package com.buba.springcloud.controller;


import org.springframework.beans.factory.annotation.Value;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class HelloController {
    @Value("${server.port}")
    private String serverPort;

    @GetMapping(value = "/provider/get/{id}")
    public String getPayment(@PathVariable("id") Integer id) {
        return "Nacos的注册中心的端口是：: " + serverPort + ",id是：" + id;
    }

    /*
    @GetMapping(value = "/provider/get/{id}")
    public String getPayment(@PathVariable("id") Integer id) {
        return "nacos registry, serverPort: " + serverPort + "\t id" + id;
    }

    @GetMapping(value = "/testA")
    public String testA() {
        //模拟异常
        int num = 10 / 0;
        return "-------testA--------";
    }

    @GetMapping(value = "/testB")
    public String testB() {
        return "~~~~~~~~testB~~~~~~~~";
    }*/

}